<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-merchant-edit" th:object="${merchant}">
            <input id="id" name="id" th:field="*{id}"  type="hidden">
			<div class="form-group">	
				<label class="col-sm-3 control-label">商户名称：</label>
				<div class="col-sm-8">
					<input id="merchantCnName" name="merchantCnName" th:field="*{merchantCnName}" class="form-control" type="text" readonly="readonly">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">推荐人：</label>
				<div class="col-sm-8">
					<input id="pHONE" name="parentPhone" th:field="*{parentPhone}" class="form-control" type="text" readonly="readonly">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">商户等级：</label>
				<div class="col-sm-8">
					<select id="level" name="level" class="form-control m-b" th:with="type=${@dict.getType('sys_merchant_level')}">
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{level}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">商户归属：</label>
				<div class="col-sm-8">
					<select id="isCompany" name="isCompany" class="form-control m-b" th:with="type=${@dict.getType('sys_merchant_is_company')}">
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{isCompany}"></option>
					</select>
				</div>
			</div>
		</form>
    </div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "system/merchant"
		$("#form-merchant-edit").validate({
			rules:{
				merchantCnName:{
					required:true,
				},
				idCardNumber:{
					required:true,
				},
				bankCode:{
					required:true,
				},
				isCompany:{
					required:true,
				},

			}
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/edit", $('#form-merchant-edit').serialize());
	        }
	    }
	</script>
</body>
</html>
